<template>
  <el-dialog v-model="dialogTableVisible">
    <form-create
      v-model="formData"
      v-model:api="fapi"
      :rule="rule"
      :option="option"
      @submit="onSubmit"
    ></form-create>
  </el-dialog>
</template>

<script>
import formCreate from "@form-create/element-ui";
import { tr } from "element-plus/es/locale/index.mjs";

export default {
  component: {
    formCreate: formCreate.$form(),
  },
  data() {
	
    const option = formCreate.parseJson(
      '{"form":{"inline":false,"hideRequiredAsterisk":false,"labelPosition":"top","size":"default","labelWidth":"125px"},"resetBtn":{"show":false,"innerText":"重置"},"submitBtn":{"show":true,"innerText":"提交"}}'
    );
    return {
	  dialogTableVisible :true,
      formData: {},
      fapi: null,
      rule: formCreate.parseJson(
        '[{"type":"input","field":"Fh6rlyp9clklbec","title":"输入框","info":"","$required":true,"_fc_id":"id_Fgxtlyp9clklbfc","name":"ref_Fjeslyp9clklbgc","display":true,"hidden":false,"_fc_drag_tag":"input"},{"type":"input","field":"F2a0lyp9cmr9bhc","title":"输入框","info":"","$required":false,"_fc_id":"id_Fg9blyp9cmr9bic","name":"ref_F5uylyp9cmr9bjc","display":true,"hidden":false,"_fc_drag_tag":"input"}]'
      ),
      option: option,
    };
  },
  methods: {
    onSubmit(formData) {
      //todo 提交表单
	  console.log(formData);
    },
  },
};
</script>
